package com.smart.tool.scheduler;

/**
 * @Author xiaoqiang
 * @Version TaskStatus.java, v 0.1 2025年08月13日 20:04 xiaoqiang
 * @Description: TODO
 */
public enum TaskStatus {
    SCHEDULED,
    RUNNING,
    COMPLETED,
    CANCELLED,
    CLOSED,
    SUSPENDED;

    public static TaskStatus fromOrdinal(long ordinal) {
        if (ordinal < 0 || ordinal >= values().length) {
            throw new IllegalArgumentException("Invalid ordinal: " + ordinal);
        }
        return values()[(int) ordinal];
    }
}
